﻿<%@ Page Title="" Language="C#" MasterPageFile="~/settings/SettingsMaster.master" AutoEventWireup="true" Inherits="Settings.Theme.DesignList" Codebehind="DesignList.aspx.cs" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 
<%@ Register src="../Controls/EntityEdit.ascx" tagname="EntityEdit" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<h2 class="pagetitle">Themes</h2>

<asp:UpdatePanel ID="udpOutterUpdatePanel" runat="server"> 
     <ContentTemplate> 

<asp:DataGrid ID="grdDesigns" runat="server" AutoGenerateColumns="false"  onitemcommand="grdDesigns_ItemCommand" OnItemDataBound="grdDesign_ItemDataBound">
    <Columns>
        <asp:BoundColumn DataField="Id" readonly="true" Visible="false"/>
        
        <asp:TemplateColumn HeaderText="Name">
            <ItemTemplate>
                <asp:Literal ID="litName" runat="server" Text='<%# Eval("Name") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                

        <asp:TemplateColumn HeaderText="State">
            <ItemTemplate>
                <asp:Literal ID="litState" runat="server" Text='<%# Eval("State") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                

        <asp:TemplateColumn HeaderText="Created by">
            <ItemTemplate>
                <asp:Literal ID="litCreatedBy" runat="server" Text='<%# Eval("CreatedBy") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                

        <asp:TemplateColumn HeaderText="Used by">
            <ItemTemplate>
                <asp:Literal ID="litUseCount" runat="server" Text='<%# Eval("UseCount") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                

        <asp:TemplateColumn ItemStyle-HorizontalAlign="Right">
            <ItemTemplate>
                <asp:Button CommandName="View" Text="Content" ButtonType="PushButton" CssClass="greenbutton"  runat="server" />
                <asp:Button CommandName="Edit" Text="Edit" ButtonType="PushButton" CssClass="greenbutton"  runat="server"/>    
                <asp:Button CommandName="Delete" Text="Delete" ButtonType="PushButton" CssClass="redbutton"  runat="server" ID="btnDelete" />    
            </ItemTemplate>
        </asp:TemplateColumn>
    </Columns>
</asp:DataGrid>

    <ajaxToolkit:ModalPopupExtender runat="server" 
        ID="mpeEditEntity" 
        TargetControlID="dummy2" 
        PopupControlID="pnlEditEntity" 
        BackgroundCssClass="modalBackground"                        
        DropShadow="false"
        /> 

     <input id="dummy2" type="button" style="display: none" runat="server" /> 
     
     <asp:Panel ID="pnlEditEntity" runat="server" CssClass="modalPopup"  style="display:none;" >             
        <asp:UpdatePanel ID="UpdatePanel1" runat="Server" UpdateMode="Conditional"> 
            <ContentTemplate>     
                <asp:ImageButton ID="Imagebutton1" runat="server" ImageUrl="~/Images/dialog-close.png" style="position:absolute; top: -10px; right:-10px;" />
                <uc1:EntityEdit ID="editDesign" runat="server" Caption="Design" OnUpdate="editDesign_Update"   />
            </ContentTemplate>       
        </asp:UpdatePanel> 
    </asp:Panel>
    
   </ContentTemplate> 
</asp:UpdatePanel> 

</asp:Content>

